package com.ipet.app.common;

import android.content.Context;

import com.ipet.app.util.FileUtil;

import java.io.File;

/**
 * Created by jindongping on 16/3/17.
 */
public class AppConfig {

    private Context context;
    private final String appFolder = FileUtil.getSDPath() + File.separator + "99Ipet";
    private final String upLodeCache = appFolder + File.separator + "upLodeCaChe";
    private static AppConfig instance;

    public static void init(Context context) {
        if (instance == null)
            instance = new AppConfig(context);
    }

    /**
     * 该类会被调用多次
     */
    public AppConfig(Context context) {
        this.context = context;
        initFolder();
    }

    private void initFolder() {
        FileUtil.CreateDirIfNotExit(appFolder);
        FileUtil.CreateDirIfNotExit(upLodeCache);
    }

    public String getUpLodeCache() {
        return upLodeCache;
    }

    public String getAppFolder() {
        return appFolder;
    }

    public static AppConfig getInstance() {
        return instance;
    }


}
